# -*- coding: utf-8 -*-
# @Time    : 2021/10/17 18:48
# @Author  : super

import furniture

class HouseClass():
	def __init__(self):
		self.location = "武汉市"
		self.use_area = 100
		self.residue_area = 100
		self.furniture = []

	def __str__(self):
		return f"这是房子类。目前在{self.location},占地面积{self.use_area},剩余面积{self.residue_area},家具列表{self.furniture}"

	def add_furniture(self, item):
		'''添加家具类'''
		if self.residue_area > item.area and self.residue_area-item.area >= 10:
			print("开始添加家具")
			self.furniture.append(item.name)
			self.residue_area -= item.area
			print("添加成功")
		else:
			print("家具放不下了")

house = HouseClass()
fur1 = furniture.furnitureClass("桌子",10)
fur2 = furniture.furnitureClass("椅子",81)

house.add_furniture(fur1)
house.add_furniture(fur2)
print(house)
